package com.cheyun.netsalev3.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.cheyun.netsalev3.bean.dm.DmKefu
import com.cheyun.netsalev3.repository.DmChatRepository
import com.cheyun.netsalev3.utils.MySharedPreferences


class DmChatViewModel(var repository: DmChatRepository) : ViewModel() {
    init {
    }
    var data = MutableLiveData<List<DmKefu>>()
    private fun setData(list: List<DmKefu>) {
        data.postValue(list)
    }

    fun getKefuList(){
        repository.getData(MySharedPreferences.getMobile(), MySharedPreferences.getLoginData()?.channel?.id!!,this::setData)
    }
}
